﻿using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis;
using System.Collections.Generic;

namespace SourceGenerator.AOP
{
    public class AopProxySyntaxReceiver : ISyntaxReceiver
    {
        //存储筛选出来标记了GeneratorAopProxyAttribute特性的类
        public List<AttributeSyntax> CandidateClasses { get; } = new List<AttributeSyntax>();
        public void OnVisitSyntaxNode(SyntaxNode syntaxNode)
        {
            if (syntaxNode is AttributeSyntax cds && cds.Name is IdentifierNameSyntax identifierName && identifierName.Identifier.ValueText == "GeneratorAopProxy")
            {
                CandidateClasses.Add(cds);
            }
        }
    }
}

